﻿@model IRIS.Models.IEContentIECategoriesViewModel

@{
    ViewBag.Title = "IRIS Ættleiðingartengd fræðsla - Greinar";
}


@section SubMenu
{
    <ul id="submenu">
    @foreach (var item in Model.m_Categories)
    { 
        <li>@Html.ActionLink(item.Name, "Groups", new { id = item.ID })</li>
    }
    </ul>
}

<!--Here comes all the articles and information related to them -->


@if (Model.m_Contents.Count() > 0)
{ 
    foreach (var item in Model.m_Contents)
    { 
    	 	
		<div class="news">
        	<h2>@Html.ActionLink(item.ContentTitle, "Details", new { id = item.ID })<span class="contentdate">
            @{ var date = item.Created.ToShortDateString();}
                @date</span> </h2>
        	<h3><b>Höfundur: </b>@item.Author</h3>
            <span><b>Flokkur: </b>@item.ContentCategory.Name</span>
        	<h6>Stutt lýsing:</h6>
            <p>@{ var segment = item.Description; }
			@Html.Raw(segment) 
            </p>          
    	</div>
    }
}
else
{
    <p>Engar greinar fundust</p>
}
<!--Pages-->
 <div id="page">
 <span>Eldra efni</span>
 <ul>
@if (Model.m_Pages > 0)
{

	for (int i = 0; i < Model.m_Pages; i++) 
	{
		<!--Workaround-->
		<li><a href="Content/page/?thePage=@i&theNews=false">@(i+1)</a></li>  
	}
}

</ul>
</div>
